<?php
// $Id$

/**
 * Controller_Admin_Trunk 控制器
 */
class Controller_Admin_Trunk extends Controller_Abstract
{
	

/**
 * 
 * 中继管理
 */
	
	function actiondel()
	{
		Syslog::logs('删除中继:'.$_POST['accountcode']);
		$this->union_table = Gateway::meta();
		$this->delete(array('id'=>$this->_context->ids));
	}
	function actionmanage()
	{
		$this->union_table = Gateway::meta();
		$this->lists();	
	}
	function actionsipadd()
	{
		$this->union_table = Gateway::meta();
		$handle = new helper_autoinsert($this->union_table);
		$form = new Form_trunk_sipadd(url('trunk/sipadd'));

		$result = $handle->add($form, 'id', $_GET);
		if ($this->_context->isGET())
		{
			$this->_view['form'] = $result;
			$this->_viewname = '../form/add';
		}else {
			Syslog::logs('编辑中继:'.$_POST['trunkname']);
			return call_user_func_array(array($this,$handle->status),array($result));
		}
	}
	
}


